package org.nokatag.tagjava;

import java.util.List;

import org.nokatag.system.FileItem;
import org.nokatag.system.FileUpload;
import org.nokatag.system.FileUploadDBSQL;
import org.nokatag.system.FileUploadSaveInterface;

public class UploadFileRead {
	/**
	 * 删除文件
	 * @param fileid
	 * @param conn
	 * @return
	 */
	public boolean DeleteFile(List<String> fileids){
		if(fileids==null)
			return false;
		String[] args = new String[fileids.size()];
		for(String sf:fileids){
			args[args.length]=sf;
		}
		List<String> filsList =FileUploadDBSQL.delAsNoka(args);//删除数据库记录
		FileUpload fuload = new FileUpload();
		FileUploadSaveInterface futil =fuload.getFileUploadSaveInterface();
		for(String filePath:filsList){
			futil.delFile(filePath);//删除文件
		}
		return false;
	}
	
	//================读取文件========================================
		/**
		 * 读取文件
		 * @param fileid
		 * @return
		 */
		public FileItem UFileRead(String fileid){
			if(fileid==null)
				return null;
			return FileUploadDBSQL.ReadFileNoka(fileid);
		}
}
